package com.youyun56.gps.android.events;

import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.TextView;

import com.youyun56.gps.android.GoodInfoActivity;
import com.youyun56.gps.android.R;

public class GoodInfoItemClickListerner implements OnItemClickListener {

    private GoodInfoActivity activity;

    public GoodInfoItemClickListerner(GoodInfoActivity activity) {
        // TODO Auto-generated constructor stub
        this.activity = activity;
    }

    @Override
    public void onItemClick(AdapterView<?> listView, View view, int index, long lineId) {
        // TODO Auto-generated method stub
        if (view != activity.getFooterView() && view != activity.getSearchInfoView()) {
            TextView contact = (TextView) view.findViewById(R.id.contact);
            contact.setVisibility(contact.getVisibility() == View.VISIBLE ? View.GONE : view.VISIBLE);
        }
    }
}
